import type { ResType } from "@/types/global";
import type {
  ArticleListRes,
  ChannelListRes,
  ReqArticleListParams,
} from "@/types/list";
import http from "@/utils/http";

/**
 * 获取频道列表的接口方法
 */
export const getChannelListAPI = () =>
  http.get<any, ResType<ChannelListRes>>("/channels");

/**
 * 获取文章列表的接口方法
 * @param params query参数
 */
export const getArticleListAPI = (params: ReqArticleListParams) =>
  http.get<any, ResType<ArticleListRes>>("/articles", { params: params });
